package club.justwill.single.persistence.support;


import javax.persistence.Column;
import javax.persistence.MappedSuperclass;
import java.sql.Timestamp;
import java.util.Date;

/**
 * Created by xiangnan on 10/28/15.
 */

@MappedSuperclass
public abstract class UserBase extends Jpo {

	@Column(name = "password")
	private String password;

	@Column(name = "nick_name")
	private String nickName;

	@Column(name = "sex")
	private Integer sex;

	@Column(name = "head_icon")
	private String headIcon;

	@Column(name = "birthday")
	private Date birthday;

	@Column(name = "balance")
	private Long balance;

	@Column(name = "type")
	private Integer type;

	@Column(name = "creation_time")
	private Timestamp creationTime;

	@Column(name = "status")
	private Integer status;

	@Column(name = "address")
	private String address;

	@Column(name = "invitation_code")
	private String invitationCode;

	@Column(name = "activity_status")
	private Integer activityStatus;

	protected void copyBase(UserBase other) {
		setType(other.getType());
		setNickName(other.getNickName());
		setPassword(other.getPassword());
		setSex(other.getSex());
		setBirthday(other.getBirthday());
		setCreationTime(other.getCreationTime());
	}
	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getInvitationCode() {
		return invitationCode;
	}

	public void setInvitationCode(String invitationCode) {
		this.invitationCode = invitationCode;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getNickName() {
		return nickName;
	}

	public void setNickName(String nickName) {
		this.nickName = nickName;
	}

	public Integer getSex() {
		return sex;
	}

	public void setSex(Integer sex) {
		this.sex = sex;
	}

	public String getHeadIcon() {
		return headIcon;
	}

	public void setHeadIcon(String headIcon) {
		this.headIcon = headIcon;
	}

	public Date getBirthday() {
		return birthday;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	public Long getBalance() {
		return balance;
	}

	public void setBalance(Long balance) {
		this.balance = balance;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public Timestamp getCreationTime() {
		return creationTime;
	}

	public void setCreationTime(Timestamp creationTime) {
		this.creationTime = creationTime;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public Integer getActivityStatus() {
		return activityStatus;
	}

	public void setActivityStatus(Integer activityStatus) {
		if(activityStatus == null){
			this.activityStatus = 0;
		}
		this.activityStatus = activityStatus;
	}
}
